home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
comm
/
cnet
/
viewlog.lha
/
viewlog5
/
VL_Config
< prev
next >
Wrap
Text File
|
1996-11-08
|
12KB
|
228 lines
/**************************************************************************\
$VER: VL_Config, v5.02 (8-Nov-96) by Dotoran!
\**************************************************************************/
options results;signal on SYNTAX;signal on ERROR;signal on IOERR
tr=transmit;se=sendstring;gc=getchar;gu=getuser;mg=maygetchar;ver="5.02"
a='rexxsupport.library';if ~show('l',a) then if ~addlib(a,0,-30) then exit
call READCONFIG;call CHECKVER;call SETUP;call SCREEN
START:;pt=it.it
se "z2c06H"center(inf.it.1,68)"6H"center(inf.it.2,68)"z0"
se "z2c0"pt"z0c979H";gc;call CHECK;a=c2d(result);do 2;mg;b=result;end
if a=27 & b="NOCHAR" then do;call SAVECONFIG;exit;end
if a=13 then signal CONFIG
if d2c(a)=8 | b="A" then do;tr it.it;it=it-1;if it<1 then it=max
signal START;end
if d2c(a)=2 | b="B" then do;tr it.it;it=it+1;if it>max then it=1
signal START;end
if d2c(a)=6 | b="C" then do;tr it.it;if index(zz," "it" ")>0 then do
a=pos(right(it,2,"0")"-",zz.1)+3
it=strip(substr(zz.1,a,2),"l","0");end;end
if d2c(a)=4 | b="D" then do;tr it.it;if index(zz," "it" ")>0 then do
a=pos(right(it,2,"0")"-",zz.2)+3
it=strip(substr(zz.2,a,2),"l","0");end;end
signal START
CONFIG:;a="CONFIG"it;signal (a)
CONFIG1:
se "2HL1305640 #"macc"}z4cfi4 15}z0";gu 70;a=result
se "2HcaVerifying...";a=PARSE(a,0,31);a=RANGE(itt.0)
macc=a;save=1;tr "2Hz4cf"left(macc,15)"z02H"copies(" ",12)
signal START
CONFIG2:
save=1;trim=trim+1;if trim>2 then trim=1
tr "22Hz4cf"left(res.trim,50)
signal START
CONFIG3:
se "22HL1305640 #"trln"}z4cfi68 5}z0";gu 70;a=result
if a~="" then do;trln=a;save=1;end;else tr "22Hz4cf"left(trln,5)"z0"
signal START
CONFIG4:
save=1;if logH=0 then logH=1;else logH=0
tr "22Hz4cf"left(word("No Yes",logH+1),3)"z0"
signal START
CONFIG5:
se "22HL1305640 #"hisP"}z4cfi4 50}z0";gu 70;a=result
se "22HcaChecking path...";if index("/:",right(a,1))=0 then a=a"/"
if ~exists(a) then do;se "22Hc9Path not found! <Key>g122H"copies(" ",22);signal CONFIG5;end
hisP=a;save=1;tr "22Hz4cf"left(hisP,50)"z022H"copies(" ",16)
signal START
CONFIG6:
se "22HL1305640 #"hisT"}z4cfi68 5}z0";gu 70;a=result
if a~="" then do;hisT=a;save=1;end;else tr "22Hz4cf"left(hisT,5)"z0"
signal START
CONFIG7:
save=1;if ARus=0 then ARus=1;else ARus=0
tr "22Hz4cf"left(word("No Yes",ARus+1),3)"z0"
signal START
CONFIG8:
se "22HL1305640 #"ARpt"}z4cfi4 50}z0";gu 70;a=result
se "22HcaChecking..."
if a>"" & (~exists(a) | right(upper(a),8)~="ANSIREAD") then do
se "22Hc9AnsiRead file not found! <Key>g122H"copies(" ",30)
signal CONFIG8 ; end ; if a="" then a="<AnsiRead Disabled>"
ARpt=a;save=1;tr "22Hz4cf"left(ARpt,50)"z022H"copies(" ",11)
signal START
CONFIG9:
se "4HL1305640 #"uacc"}z4cfi4 15}z0";gu 70;a=result
se "4HcaVerifying...";a=PARSE(a,0,31);a=RANGE(a)
uacc=a;save=1;tr "4Hz4cf"left(uacc,15)"z04H"copies(" ",12)
signal START
CONFIG10:
se "54HL1305640 #"ETex"}z4cfi4 5}z0";gu 70;a=result
ETex=a;save=1;tr "54Hz4cf"left(ETex,5)"z0"
signal START
CONFIG11:
save=1;if ARsy=0 then ARsy=1;else ARsy=0
tr "54Hz4cf"left(word("No Yes",ARsy+1),3)"z0"
signal START
SAVECONFIG:;if save=0 then return
call open(f1,comP"ViewLog5.cfg","w")
call writeln(f1,vers);call writeln(f1,macc)
call writeln(f1,uacc);call writeln(f1,trim);call writeln(f1,trln)
call writeln(f1,logH);call writeln(f1,hisP);call writeln(f1,hisT)
call writeln(f1,ETex)
call writeln(f1,ARus);call writeln(f1,ARsy);call writeln(f1,ARpt)
call close(f1)
return
READCONFIG:;gu 1311992;comP=result
call open(f1,comP"ViewLog5.cfg","r")
vers=readln(f1);macc=readln(f1)
uacc=readln(f1);trim=readln(f1);trln=readln(f1)
logH=readln(f1);hisP=readln(f1);hisT=readln(f1)
ETex=readln(f1)
ARus=readln(f1);ARsy=readln(f1);ARpt=readln(f1)
call close(f1)
return
CHECKVER: ; if ver=vers then return
tr "f1n6c9Version Conflict:n1"
tr " `ViewLog5.cfg' version: v"vers
tr " `VL_Config' version: v"ver
tr "n1 BOTH files above need to be v"max(ver,vers)"!"
tr "n1Halting, due to conflicting versions..."
exit
SETUP: it=1;max=11;save=0;tr "f1"
zz=" 1 6 7 9 10 11 ";zz.1="01-09-01-06-10-06-07-11-07"
zz.2="09-01-09-10-06-10-11-07-11"
it.1="HMaint Access"
it.2="9HLog Restart"
it.3="9HTrim Length"
it.4="7HUse Histories"
it.5="8HHistory Path"
it.6="8HHistory Trim"
it.7="7HAnsiRead w/LF"
it.8="7HAnsiRead Path"
it.9="1HUser Access"
it.10="37HYour ET Command"
it.11="39HAnsiRead w/VL"
res.1="Let Maint User(s) Trim Logs using SysOp ViewLog."
res.2="Automatically Trim Logs during AutoMaintenance."
inf.1.1="The Access Group RANGE of all users who will have the ability to"
inf.1.2="delete, trim, and view ALL defined logs and histories."
inf.2.1="The DEFAULT method of restarting a log. You can opt to delete or"
inf.2.2="trim the logs & histories yourself, or let automaintenance do it."
inf.3.1="The DEFAULT number of lines to trim a log down to. As with the View"
inf.3.2="Accesses, EACH log has it's OWN trim value specified in VL_Maint."
inf.4.1="If you choose to use Log Histories, a second copy of the log will be"
inf.4.2="maintained from deleted logs, or trimmed portions of current logs."
inf.5.1="Enter the physical path where all Log History files should be saved"
inf.5.2="to. Make the path / or : terminated, and should NOT be SysData:Log/"
inf.6.1="The DEFAULT number of lines you wish each log history trimmed to."
inf.6.2="VL_Maint uses individual trim settings. Use 0 to disable trimming."
inf.7.1="Specifying YES here will allow the additional use of the AnsiRead"
inf.7.2="Program for the USERS when they choose to use the LF command."
inf.8.1="Enter the full path(and filename) where the AnsiRead file can be"
inf.8.2="located on your system. Empty the gadget to disable AnsiRead."
inf.9.1="The DEFAULT Access Group RANGE of all users who will be able to VIEW"
inf.9.2="log files. Using VL_Maint, EACH log can use it's own Access Range."
inf.10.1="Enter your ET command here, if it differs from the CNet default use"
inf.10.2="of ET. Users of Non-Ansi Terminals will be told to use this command."
inf.11.1="Specifying YES here will allow the additional use of the AnsiRead"
inf.11.2="Program for the SYSOP when he/she chooses to use the VL command."
return
SCREEN:
se "@4
Û
ÜCÜ
Û Þ
ÛÛ
Ý Ü
ÜÜÜÜÜ
Û Û"
se "
ÛCÞÝCÛ
Û
ÞÝ
CÜÛ
ÜÜÜ
ÛÜ ÜÛ
ÜÜÜÜ"
tr "
Ü Û
ÜÜÜÜÜ
Û ÜÛ
ÜÜÜ
Ü"
se "
ÚÄ
Û
Û
ÄÄÄ
Û
Û
ÄÄ
ÞÝ
ÄÄ
Û
"
se "ÛÜÜÜ
Ü
ÄÄ
Û
Û
Ä
ÞÝ
Ä
Û
Û
Ä"
se "
ÞÝ
ÄÄÄÄÄÄ
Û
Û
ÄÄÄ
Û
Û
Ä
Û
Û"
se "
ÄÄ
ÜÜÜ
ÄÄÄ
Û
Û
ÜÜ
ÜÜ
ÄÄÄÄÄ
Û
Û"
tr "
ÄÄ
Ü
Û
Û
ÄÄ¿"
se "³
Ú
Û
ß
Ü
Ä
Ü
ß
Û
ÄÄ
ÞÝ
ÄÄ
Û"
se "
Û
ßßßß
ÄÄ
Û
Û
Ä
ÞÝ
Ä
Û
Û
Ä"
se "
ÞÝ
ÄÄÄÄÄÄ
Û
Û
ÄÄÄ
Û
Û
Ä
Û
Û"
se "
ÄÄÄ
Û
Û
ÄÄÄÄ
ßß
ßßÛ
Û
ÄÄÄÄ
Û
Û
"
tr "Üß
Ä
Û
Û
Ä¿
³"
se "³
³
ßÛ
ß
Ûß Þ
ÛÛ
Ý ß
ßßßßß
Û ßÛ
"
se "ßßßß
Ûß
ßßßßß
ßÛ
ßßß
Ûß ßÛ
ßßßß
ß Û"
tr "
ßßßßß
ß
ÞÝ
ß
ßßß
ß
³
³"
tr "³
"copies("°",77)"
³"
tr "
°°±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±±°°"
tr "°±±²
ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ
²±±°"
tr "°±²Û
Ý
Maint Access
:
User Access
:
CÞ
Û²±°"
tr "°±²Û
ÝCÞ
Û²±°"
tr "°±²Û
Ý
Log Restart
:
Þ
Û²±°"
tr "°±²Û
Ý
Trim Length
:
CÞ
Û²±°"
tr "°±²Û
ÝC
Use the
Arrow Keys
to
Move
,
ENTER
to
Edit
,
Þ
Û²±°"
tr "°±²Û
Ý
Use Histories
:
<
ESC
>
to
Save
/
Quit
. Look
below
for
Help
...
Þ
Û²±°"
tr "°±²Û
Ý
History Path
:
Þ
Û²±°"
tr "°±²Û
Ý
History Trim
:
Your ET Command
:
Þ
Û²±°"
tr "°±²Û
ÝCÞ
Û²±°"
tr "°±²Û
Ý
AnsiRead w/LF
:
CAnsiRead w/VL
:
CÞ
Û²±°"
tr "°±²Û
Ý
AnsiRead Path
:
Þ
Û²±°"
tr "°±²Û
ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ
Û²±°"
tr "°±²²Û
ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ
²²±°"
tr "°±±²
Û
²±±°"
tr "°°±±
ß
±±°°"
tr " °°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°"
se "2Hz4cf"left(macc,15)"z0"
se "4Hz4cf"left(uacc,15)"z0"
se "22Hz4cf"left(res.trim,50)"z0"
se "22Hz4cf"left(trln,5)"z0"
se "22Hz4cf"left(word("No Yes",logH+1),3)"z0"
se "22Hz4cf"left(hisP,50)"z0"
se "22Hz4cf"left(hisT,5)"z0"
se "54Hz4cf"left(ETex,5)"z0"
se "22Hz4cf"left(word("No Yes",ARus+1),3)"z0"
se "54Hz4cf"left(word("No Yes",ARsy+1),3)"z0"
se "22Hz4cf"left(ARpt,50)"z0"
return
PARSE:;arg rng,min,maxx;itt.='';c=0;itt=translate(rng,' ','.,');do a=1 to words(itt);c=c+1;itt.c=word(itt,a)
if index(itt.c,'-')>0 then do;parse var itt.c x'-'y;if y='' then y=maxx;if x='' then x=min;if x>y then do;d=x;x=y;y=d;end
if x<min|y>maxx|~datatype(x,'W')|~datatype(y,'W') then do;c=c-1;iterate;end;do b=x to y;itt.c=b;c=c+1;end;c=c-1;end
else if itt.c<min|itt.c>maxx|~datatype(itt.c,'W') then do;c=c-1;iterate;end;end
a=0;do i=1 to c;j=i+1;if itt.i~=itt.j then do;a=a+1;itt.a=itt.i;end;end;c=a;do i=1 to c;itt.0=itt.0||itt.i' ';end
return itt.0
RANGE:;arg gr;a="";if words(gr)=1 then return strip(gr)
do i=1 to words(gr);j=i+1;v1=word(gr,i);v2=word(gr,j)
if v2-v1=1 then do;s=v1
do while v2-v1=1;i=i+1;j=j+1;v1=word(gr,i);v2=word(gr,j)
if v2="" then leave;end;a=a||s"-"v1",";iterate i;end;a=a||v1",";end i
return strip(a,'t',',')
CHECK:;if result~="###PANIC" then return result ; else call SAVECONFIG
a="Lost Carrier!";tr "1Hc9"a;logentry a;bufferflush;exit
SYNTAX:;ERROR:;IOERR:;e1=' Error: 'rc' ('errortext(rc)')'
e2=' Line: 'left(sigl,4)'File:';gu 1311992;a=result;gu 1311960
b=result;c='"'a||b'"';e2=e2' 'c;tr e1;tr e2;logentry e1;logentry e2
e=translate(sourceline(sigl),"\{","");do while e~=''
e3='Source: 'left(e,37);tr e3;logentry e3;e=substr(e,38);end;bufferflush
/**************************************************************************\
\****************************************** Frontiers BBS (716)/823-9892 **/